package org.elsfs.cloud.common.mybatis.ext.sql.support.condition;


import lombok.RequiredArgsConstructor;

/**
 * 子查询为空条件
 *
 */
@RequiredArgsConstructor
public class IsNullSubQueryConditionItem implements ConditionItem {

    /**
     * SQL
     */
    protected final String sql;

    /**
     * 构建SQL片段
     *
     * @return SQL片段
     */
    @Override
    public String buildSqlFragment() {
        return String.format(
            "(%s) IS NULL",
            this.sql
        );
    }
}
